#ifndef _OBJECT3D_H_
#define _OBJECT3D_H_

#include "types.h"

class CObject3D;


class CObject3D
{
public:
#pragma pack(1)
	typedef struct
	{
		float x,y,z;
	}TPoint3D;

	typedef struct
	{
		float x,y;
	}TPoint2D;

	typedef struct
	{
		DWORD vert[3];
		DWORD tvert[3];
		TPoint3D normal[3];
		DWORD smoothGrp;
		DWORD flags;
	}TFace;

	typedef struct
	{
		DWORD signature;
		BYTE version;
		DWORD nrVert;
		DWORD nrTVert;
		DWORD nrFaces;
		BYTE padding[15];
	}T3DBHeader;
#pragma pack()
private:
	T3DBHeader header;
	TPoint3D *m_verts;
	TPoint2D *m_tverts;
	TFace *m_faces;
public:
	CObject3D(char *fname);

	void render();
};
#endif //_OBJECT3D_H_